package demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;

@EnableAutoConfiguration          // 启用自动配置
@ComponentScan(basePackages="demo")  // 显示指定包扫描组件
@SpringBootApplication               // 使用此注解时,已包含上述注解
public class SpringBootAopUnifiedLogApplication {
    public static void  loop_task()
    {
        int cnt = 0;
        for(int i=0; i < 1e9; i++)
        {
            cnt++;
        }
    }

    public static void timecost_demo1(){
        long start = System.currentTimeMillis();
        loop_task(); // 执行代码块
        long end = System.currentTimeMillis();
        System.out.println("func time costs "+ (end - start) + " ms");
    }


    public static void main(String[] args) {
        //http://localhost:8080/hello
		ApplicationContext ctx = SpringApplication.run(SpringBootAopUnifiedLogApplication.class, args);
	}
}
